<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:f="http://java.sun.com/jsf/core">

<cc:interface>
<cc:attribute name="value" required="true" 
type="com.web.surf.sample.eshop.faces.managed.beans.GoodsBean" />
<cc:attribute name="linkAction" method-signature="java.lang.String action()"/>
<cc:attribute name="linkListener" method-signature="void action(javax.faces.event.ActionEvent)"/>
<cc:attribute name="chooseListener" method-signature="void action(javax.faces.event.ActionEvent)"/>
<cc:attribute name="confirmListener" method-signature="void action(javax.faces.event.ActionEvent)"/>
<cc:attribute name="rejectListener" method-signature="void action(javax.faces.event.ActionEvent)"/>
</cc:interface>

<cc:implementation>

<table id="#{cc.attrs.value.goodsID}" style="width: 400px;
						height: 93px;
						opacity:0.7;
						filter:alpha(opacity=70);
						background: url('resources/images/paper017.jpg');
						margin-bottom: 10px;
						border:0;
						table-lowout: fixed;">
	<tr>
			
	<th style="width: 100px;
				height: 93px;
				border-bottom:3px solid #665011;
				border-top:3px solid #665011;
				border-left:3px solid #665011;">
				
 		<div style="border:2px solid #665011;
					position: relative;
					margin: 2px;
					height: 90px;
					width: 90px;">
  		<a href="#">  		
  		<h:graphicImage value="image?id=#{cc.attrs.value.goodsID}" /> </a>
 		</div> 		
	</th>	
	
	<td style="width: 200px;
				height: 93px;
				border-bottom:3px solid #665011;
				border-top:3px solid #665011;
				border-right:3px solid #665011;">
		<p style="font-weight: bold;
					font-size: 15px;
					color: black;
					text-decoration: uppercase;
					text-align: left;"> 
		#{cc.attrs.value.producerValue} #{cc.attrs.value.modelValue} 
		</p>
		<p style="font-weight: bold;
					font-size: 20px;
					color: green;
					text-decoration: uppercase;
					text-align: center;">
		<h:outputText value="#{cc.attrs.value.priceBYRValue}">
		<f:converter binding="#{priceConverter.instance}" /> </h:outputText>		
		 </p>
		 
		 <p>	
		 	
		<h:commandLink id="link" value="#{cc.attrs.value.modelValue} features" 
		action="#{cc.attrs.linkAction}" actionListener="#{cc.attrs.linkListener}"
				style="font-style:italic;
					font-weight:bold;
					align:right;
					vertical-align: bottom;
					color: blue;">
		<f:param name="redirect" value="#{cc.attrs.value.goodsID}"/>		
		</h:commandLink>
			
		</p>		
	</td>	
	
	<th style="width: 100px;
				height: 93px;
				color:black;
				font-weight: bold;
				align: center;">			
		<br/>
		<h:commandButton id="choose" value="Choose" actionListener="#{cc.attrs.chooseListener}" disabled="#{basketBacking.chooseParam>0}" >
		<f:param name="choose" value="#{cc.attrs.value.goodsID}"/>
		</h:commandButton>
		<br/>
		<h:inputText id="number" label="How many?" value="#{basketBacking.chosenGoodsNumber}" 
		rendered="#{cc.attrs.value.goodsID==basketBacking.chooseParam}" size="6">
		<f:validateRequired/>		
		</h:inputText>
		<br/>
		<h:commandButton id="confirm" value="Confirm" actionListener="#{cc.attrs.confirmListener}" 
		rendered="#{cc.attrs.value.goodsID==basketBacking.chooseParam}" />
		<h:commandButton id="reject" value="Reject" actionListener="#{cc.attrs.rejectListener}" 
		rendered="#{cc.attrs.value.goodsID==basketBacking.chooseParam}" />			
	</th>
		
	</tr>
</table> 

</cc:implementation>

</html>